class Tab {
    constructor(el, option = {}) {
        this.el = document.querySelector(el)
        this.init()
    }
    init() {
        this.shang()
        this.xia(0)
    }
    shang() {
        let ulLiObj = this.el.querySelectorAll('ul li')
        ulLiObj.forEach((item, index) => {
            // this.el.querySelector('ul li.active').removeAttribute("class")
            // ulLiObj[index].className = 'active'
            item.onclick = () => {
                // ulLiObj.forEach(item => {
                //     item.className = ''
                // })
                this.el.querySelector('ul li.active').removeAttribute("class")

                ulLiObj[index].className = 'active'
                this.xia(index)
            }
        })
    }
    xia(index) {
        let olLiObj = this.el.querySelectorAll('ol li')
        olLiObj.forEach((item) => {
            item.className = ''
            olLiObj[index].className = 'active'
        })
    }
}

